//package com.chenl.consumer.DEMOS.幂等注解;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.servlet.HandlerInterceptor;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
//@Slf4j
//public class MyInterceptor implements HandlerInterceptor {
//    @Override
//    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
////        String traceId = request.getHeader("traceId");
////        String traceIdKey="traceId";
////        if (traceId!=null){
////            log.info("注入请求头中的traceID");
////            MDC.put(traceIdKey,traceId);
////            return true;
////        }
////        traceId= MDCUtils.mdc();
////        log.info("注入新生成的的traceID:{}",traceId);
////        request.setAttribute(traceIdKey,traceId);
////        MDC.clear();
////        MDC.put(traceIdKey,traceId);
////        TtlThreadLocal.set(MDC.getCopyOfContextMap());//利用阿里的TTL设置上下文对象供子线程传递
////        LogThreadLocal.set(JSONObject.parseObject(request.getHeader("log")!=null?URLDecoder.decode(request.getHeader("log")):"", LogVo.class));
//        log.info("拦截器2来咯22");
//        return true;
//    }
//}
